﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace Admin.Admin.AdminMan
{
    public partial class AdminList : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            IsLogin();

            //验证是不是超级管理员，只有超级管理员才有权利访问页面
            if (!this.isSuperAdmin)
            {
                Maticsoft.Common.MessageBox.ShowAndRedirect(this, "您暂时没有权利访问该页面", "../index.aspx");
                return;
            }

            if (!IsPostBack)
            {
                Bind();
            }

        }

        protected void Bind()
        {
            DataTable adminsDt = new NS.BLL.Admins().GetAllList().Tables[0];
            this.Admins.DataSource = adminsDt;
            this.Admins.DataBind();
        }

        protected string GetIdentity(int isSuper)
        {
            string identiy = "";
            switch (isSuper)
            {
                case 0:
                    identiy = "管理员"; break;
                case 1:
                    identiy = "超级管理员"; break;
            }
            return identiy;
        }
    }
}